package com.xindacloud.sms.console.system.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xindacloud.sms.console.result.Result;
import com.xindacloud.sms.console.system.dto.SmsEmailSettingDTO;
import com.xindacloud.sms.console.system.entity.SmsEmailSetting;
import com.xindacloud.sms.console.system.service.ISmsEmailSettingService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author czc
 * @since 2019-10-14
 */
@Api(tags = {"网站邮箱配置模块"})
@RestController
@RequestMapping("/api/vi/sms-email-setting")
public class SmsEmailSettingController {

	@Autowired
	private ISmsEmailSettingService smsEmailSettingService;
	
	@ApiOperation(value = "获取网站邮箱配置",response=SmsEmailSetting.class)
	@PostMapping(value = "/getSmsEmailSetting")
	public Result getSmsEmailSetting(@RequestBody SmsEmailSettingDTO smsEmailSettingDTO) {
	    return smsEmailSettingService.getSmsEmailSetting(smsEmailSettingDTO);
	}
	
	@ApiOperation(value = "保存或修改网站邮箱配置")
	@PostMapping(value = "/saveOrUpdateSmsEmailSetting")
	public Result saveOrUpdateSmsEmailSetting(@RequestBody SmsEmailSetting smsEmailSetting) {
	    return smsEmailSettingService.saveOrUpdateSmsEmailSetting(smsEmailSetting);
	}

}
